package com.aaa.controller;

import com.aaa.entity.FUser;
import com.aaa.service.FuserService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RequestMapping("fuser")
public class FuserController {
    @Resource
    FuserService fuserService;
    @RequestMapping("login")
    public Object select(FUser fUser){
        if(fuserService.selectByNP(fUser).size()>0){
        return "登陆成功";
        }else{
            return "登陆失败";
        }
    }
    @RequestMapping("updateP")
    public Object updateP(FUser fUser){
        return fuserService.updateP(fUser);
    }
    @RequestMapping("updateSelf")
    public Object updateSelf(FUser fUser){
       return fuserService.updateSelf(fUser);
    }
    @RequestMapping("updatePhone")
    public Object updatePhone(FUser fUser){
        return fuserService.updatePhone(fUser);
    }

    @RequestMapping("select")
    @ResponseBody
    public Object select(Integer pageCode,Integer pageSize,FUser fuser){
        return fuserService.select(pageCode, pageSize, fuser);
    }
    @RequestMapping("updateS")
    @ResponseBody
    public Integer updateS(FUser f_user) {
        return fuserService.updateS(f_user);
    }
}
